﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Objects;
using System.Linq;
using System.Text;
using DiscoveryLogic.DataServices.DataObjects.Entities;

namespace DiscoveryLogic.DataAccess
{
    public class PagedDataProvider
    {
        public static List<Entity> GetEntities(
            string connName, string query,
            string orderField, bool desc, 
            int skip, int grab, out int total)
        {
            string connStr = ConfigurationManager.ConnectionStrings[connName].ConnectionString;
            connStr = new System.Data.EntityClient.EntityConnectionStringBuilder()
                          {
                              Metadata = "res://*",
                              Provider = "System.Data.Client",
                              ProviderConnectionString = connStr
                          }.ConnectionString;
            ObjectContext ctx=new ObjectContext(connStr);
            ObjectQuery<Entity> eq = ctx.CreateQuery<Entity>(query,null);
            
            total = 0;
            return new List<Entity>();
        }
    }
}
